
import copy

import numpy as np


class Activity(object):
    """
    活动类
    """

    def __init__(self, id, modeNum, successor, successors):
        """
        活动对象实例化
        :param id:
        :param modeNum:
        :param successor:
        :param successors:
        """
        self.id = id
        self.modeNum = modeNum
        self.successor = successor
        self.successors = successors
        self.preList = None
        self.modes = None
        self.cost = None
        self.visited = False
        """
        duration = modes[modeStr[0]][0]
        """
        """modes = {1:[2,3,4],
                    2:[]}
                    modes[1] == [2,3,4]
                    modes[1][0] == 2
        :key:mode
        values:[]
        values[0]:duration
        values[1:]:resources
        """
        self.es = -1
        self.ef = -1
        self.ls = -1
        self.lf = -1

    def __str__(self):
        return "id:" + str(self.id) + '\n' + "modeNum:" + str(self.modeNum) + '\n' + "successor:" + str(
            self.successor) + '\n' + "successors:" + str(self.successors) + '\n' "preList:" + str(
            self.preList) + '\n' + "modes:" + str(self.modes) + '\n' + "cost:" + str(self.cost) + "\n "
